package com.example.menhoo.toollibrary.common.utils;

/**
 * 判断800毫秒内是否快速的执行了一些代码
 * Created by yanglei on 15/9/25.
 */
public class FastClickUtils {
    private static long lastClickTime;
    public static boolean isFastClick(long Dt) {
        long time = System.currentTimeMillis();
        long timeD = time - lastClickTime;


        if ( 0 < timeD && timeD < Dt) {
            return true;
        }
        else{
            lastClickTime = time;
            return false;
        }

    }

    /**
     * 默认800毫秒
     * @return
     */
    public static boolean isFastClick() {
        return isFastClick(800);
    }
}
